package main.java.design.abstractfactory;

/**
 * <p>
 *     抽象工厂模式
 * </p>
 *
 * @author : wangdejian
 * @version 1.0
 * @date : 2020/6/10 21:32
 */
public class TestAbstractFactory {

    public static void main(String[] args) {
        AbstractFactory appleFactory = new AppleFactory();
        AbstractFactory huaWeiFactory = new HuaWeiFactory();

        Phone applePhone = appleFactory.producePhone();
        applePhone.phoneName(); // 苹果手机产品
        Laptop appleLaptop = appleFactory.produceLaptop();
        appleLaptop.laptopName(); // 苹果笔记本产品

        Phone huaWeiPhone = huaWeiFactory.producePhone();
        huaWeiPhone.phoneName(); // 华为手机产品
        Laptop huaWeiLaptop = huaWeiFactory.produceLaptop();
        huaWeiLaptop.laptopName(); // 华为笔记本产品

    }
}
